//
//  WLiCarouselDelegate.h
//  舒睡
//
//  Created by 王亮 on 2020/9/24.
//  Copyright © 2020 舒睡. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "iCarousel.h"
#import "WLiCarouselModel.h"

NS_ASSUME_NONNULL_BEGIN
/**
 {
     iCarouselTypeLinear = 0,           //线性类型
     iCarouselTypeRotary,               //可旋转类型
     iCarouselTypeInvertedRotary,       //反向旋转类型
     iCarouselTypeCylinder,             //圆柱类型
     iCarouselTypeInvertedCylinder,     //反向圆柱类型
     iCarouselTypeWheel,                //车轮类型
     iCarouselTypeInvertedWheel,        //反向车轮类型
     iCarouselTypeCoverFlow,            //封面流类型
     iCarouselTypeCoverFlow2,           //封面流类型2
     iCarouselTypeTimeMachine,          //时光机类型
     iCarouselTypeInvertedTimeMachine,  //反向时光机类型
     iCarouselTypeCustom                //可自定义Carousel类型
 }
 */
@protocol WLCollectionDelegate <NSObject>
//必须实现
@required
//创建视图,仅仅在当前item view为空的时候回掉，即每个item调用一次
- (UIView *)wl_carousel:(iCarousel *)carousel
     viewForItemAtIndex:(NSInteger)index
                  model:(WLiCarouselRow *)model;
//视图数据改变等，相当于显示视图复用数据重赋值回掉
- (void)wl_carousel:(iCarousel *)carousel
 viewForItemAtIndex:(NSInteger)index
              model:(WLiCarouselRow *)model
        reusingView:(nullable UIView *)view;
//非必须实现
@optional
//carousel结束滚动动画
- (void)wl_carouselDidEndScrollingAnimation:(iCarousel *)carousel index:(NSInteger)index row:(WLiCarouselRow *)row;
//点击carousel视图触发该方法，类似于tableView:didSelectRowAtIndexPath:方法
- (void)wl_carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index row:(WLiCarouselRow *)row;
//将要点击carousel视图触发该方法
- (BOOL)wl_carousel:(iCarousel *)carousel shouldSelectItemAtIndex:(NSInteger)index row:(WLiCarouselRow *)row;
@end
@interface WLiCarouselDelegate : NSObject <iCarouselDelegate,iCarouselDataSource>
@property(nonatomic,weak) id<WLCollectionDelegate> delegate;

- (instancetype)initWithDelegate:(id)delegate;

@property(nonatomic,strong) WLiCarouselModel *viewModel;

@end

NS_ASSUME_NONNULL_END
